package ru.nlezhnev.services.request_processor;

import java.sql.Connection;
import java.sql.SQLException;

import ru.nlezhnev.data_models.FarmDataModel;
import ru.nlezhnev.db.Database;

public class InitUser extends FarmRequestProcessor {

	public InitUser(byte[] inputData, String vid, String methodName) {
		super(inputData, vid, methodName);
	}

//	@SuppressWarnings("unchecked")
	protected Object performRequest() throws SQLException {
		Connection conn = Database.getInstance().getConnection();
		FarmDataModel farm = new FarmDataModel(conn, uid);
		conn.close();
		return prepareResponseData(farm.getData());
	}
}
